package reflect;

import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;

/**
 * @author wangyingjie
 * @date
 * @remark
 */
public class A {
//    /**
//     * 类加载器加载的核心类库
//     * @param args
//     */
//    public static void main(String[] args) {
//        URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
//        for (URL urL : urLs) {
//            System.out.println(urL);
//        }
//    }


    public static void main(String[] args) throws IOException {
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println("系统类加载器："+systemClassLoader);
        //系统类加载器路径
        Enumeration<URL> resources = systemClassLoader.getResources("");
        while (resources.hasMoreElements()){
            System.out.println("系统类加载器路径："+resources.nextElement());
        }
        //系统类加载器的父加载器--扩展加载器
        ClassLoader extendClassloader = systemClassLoader.getParent();
        System.out.println("扩展类加载器："+extendClassloader);
        System.out.println("扩展类加载器路径："+System.getProperty("java.ext.dirs"));
        System.out.println("扩展类加载器的父加载器"+extendClassloader.getParent());
    }
}
